home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
shells
/
kiss-0.11
/
kiss-0
/
kiss
/
src
/
dorecall.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-23
|
507b
|
25 lines
#include "kiss.h"
int dorecall (Stringstack s)
{
register int
j,
i;
if (s.nstr != 2)
error ("recall command needs one argument");
for (i = nhislist - 1; i >= 0; i--)
if (! strncmp (s.str [1], hislist [i].str [0], strlen (s.str [1])))
{
for (j = 0; j < hislist [i].nstr; j++)
printf ("%s ", hislist [i].str [j]);
putchar ('\n');
runcmd (hislist [i]);
return (laststatus);
}
return (warning ("\"%s\": no such command in history list",
s.str [1]));
}